package app.util;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author shishun.wang
 * @date 2016年5月12日 下午8:46:32
 * @version 1.0
 * @describe
 */
public class PageInfo<T> implements Serializable {

	private static final long serialVersionUID = 1L;

	private final List<T> content;
	private final int totalPage;
	private final long totalSize;

	public PageInfo(List<T> content, int totalPage, long totalSize) {
		this.content = content == null ? new ArrayList<>() : content;
		this.totalPage = totalPage < 0 ? 0 : totalPage;
		this.totalSize = totalSize < 0 ? 0 : totalSize;
	}

	public List<T> getContent() {
		return content;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public long getTotalSize() {
		return totalSize;
	}
}
